<?php

include "koneksi.php";

$response = array();
  
    $username = $_POST['id_member'];
	$password = $_POST['password'];
	$encrypt_password = md5($password);

	$cek_login = mysql_query("SELECT * FROM member WHERE id_member='$username' AND password='$encrypt_password' AND aktifasi='ACTIVE' ");
	
	if(mysql_num_rows($cek_login) == 1){
	
		$r = mysql_fetch_array($cek_login);
		
		$response["hasil"] = 1;
		$response["id_member"] = $r["id_member"];
		$response["pesan"] = "Login Berhasil.";

		echo json_encode($response);
	
	}
	else{
	
		$response["hasil"] = 0;
		$response["pesan"] = "Wrong Password.";
		
		echo json_encode($response);

	}

?>